﻿using System;
using System.Windows;
using System.Windows.Media.Animation;

namespace Comarch.Animation.WPFExample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            LayoutUpdated +=MainWindow_LayoutUpdated;
        }

        private void MainWindow_LayoutUpdated(object sender, EventArgs e)
        {
            
           // border.Opacity = 0;
           // new Storyboard().AddStoryboard(1000, effect)
          //     .AddStoryboardsForObjects(1000,100,effect1,stack)
          //      .Begin();
        }

        private void effect1(FrameworkElement element, StoryboardBuilder sbb)
        {
            sbb.SetDefaultEasingFunction(new BounceEase()) .EntranceEffects.OffsetFadeIn(element, 500);
        }

        private void effect(StoryboardBuilder sbb)
        {
            sbb.EntranceEffects.FlyIn(border);
            //EntranceEffects.OffsetFadeIn(border, 1500)
            //.Show(border)
            //.Translate(border, 100, 100, 500)
            //.SeekToEnd().Translate(border, 0, 100)
            //.SeekToEnd().Translate(border, 400, 100);

        }
    }
}
